<?
require_once("lang.php");

$start_time = microtime_float();

//ob_start("callback");

//Đếm số lượng người truy cập
$db_visited	= new db_execute("UPDATE visited SET vis_counter = vis_counter + 1");
unset($db_visited);

$module = 'news';

// lấy thông tin sản phẩm
$iData = getValue('iData');
$db_detail	= new db_query('SELECT * FROM (categories_multi, news_multi) INNER JOIN news_hits ON new_id = nh_id WHERE new_id = ' . $iData . ' AND cat_id = new_category_id AND categories_multi.lang_id = ' . $lang_id . ' LIMIT 1');
$detail = mysql_fetch_array($db_detail->result);
unset($db_detail);
if (!$detail)
{
	redirect($con_root_path . 'notfound.html');
}

$nData = $detail['new_title'];
$nCat = $detail['cat_name'];
$iCat = $detail['cat_id'];

// tang so luot xem san pham
$db_ph	= new db_execute('UPDATE news_hits SET nh_hits = nh_hits + 1 WHERE nh_id=' . $detail['new_id']);
unset($db_ph);

// meta keyword, meta description
$news_keywords = implode(',', explode(' ', $nData));
$meta_keywords = $news_keywords . ',' . $nCat;
$meta_description = $detail['new_teaser'];
$site_title = $nData .  ' | ' . $nCat;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="keywords" content="<?=str_replace("\n", "", htmlspecialchars($meta_keywords))?>" />
<meta name="description" content="<?=str_replace("\n", "", htmlspecialchars($meta_description))?>" />
<meta property="og:image" content="/news_pictures/small_<?php echo $detail['new_picture'];?>"/>
<link href="<?=$gs_imagepath?>favicon.ico" rel="icon" type="image/x-icon" />
<link href="<?=$gs_imagepath?>favicon.ico" rel="shortcut icon" />
<title><?=$site_title?></title>
<style type="text/css" media="all">@import "<?=$theme_csspath?>main.css";</style>
<style type="text/css" media="all">@import "<?=$theme_csspath?>thickbox.css";</style>
<style type="text/css" media="all">@import "<?=$theme_imagepath?>theme.css";</style>
<style type="text/css" media="all">@import "<?=$theme_imagepath?>detail_news.css";</style>
</head>
<body<?=$body_style?>>
<div id="body"<?=$div_id_body_style?>>
	<div id="container_body">
    	<div id="container_header"><? include($real_path . "includes/inc_header.php");?></div>
        <div id="container_content">
        	<div id="container_content_left">
            <?
			include($real_path . "includes/inc_module_left_menu_news.php");
			include($real_path . "includes/inc_module_online_support.php");
			include($real_path . "includes/inc_module_left_banner.php");
			include($real_path . "includes/inc_module_statistic.php");
			?>
            </div>
            <div id="container_content_center">
            <?
			include($real_path . "includes/inc_module_center_search_form.php");
			include($real_path . "includes/inc_detail_news.php");
			?>
            </div>
            <div id="container_content_right">
            <?
			include($real_path . "includes/inc_module_hot_news.php");
			include($real_path . "includes/inc_module_right_banner.php");
			?>
            </div>
        	<div class="clear"></div>
        </div>
    	<div id="container_footer"><? include($real_path . "includes/inc_footer.php");?></div>
    </div>
</div>
</body>
</html>
<?
//ob_end_flush();
?>